package com.briup.day17;

import java.io.ByteArrayInputStream;

/**
 * 字节数组输入流 读取内存中的信息加载java程序中
 * @author lining
 * @date 2024/1/29 11:33
 */
public class TestByteArrayInputSteam {
    public static void main(String[] args) throws Exception{
        //1.声明并创建流
        byte[] arr = {97,98,99}; //设备

        ByteArrayInputStream bis = new ByteArrayInputStream(arr);
        //2.读操作
        System.out.println(bis.read());
        System.out.println(bis.read());
        System.out.println(bis.read());
        System.out.println(bis.read());
        System.out.println(bis.read());
        //3.关闭流(不需要)
        bis.close();
    }
}
